package com.drone.drone_server.api;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ApiResponse {
    private Integer code;
    private Object data;
    private String message;

    public static ApiResponse success() {
        return new ApiResponse(200, null, null);
    }

    public static ApiResponse success(Object data) {
        return new ApiResponse(200, data, null);
    }

    public static ApiResponse fail() {
        return new ApiResponse(500, null, null);
    }

    public static ApiResponse fail(String message) {
        return new ApiResponse(500, null, message);
    }
}
